<template>
    <el-dialog
      title="提示"
      :visible.sync="loseEfficacyModal"
      width="280px"
      :before-close="handleClose"
      :close-on-click-modal="false"
      :append-to-body="true"
      :show-close="false"
      align="center"
      top="30vh"
    >
      <div slot="title"></div>
      <img src="@/assets/svg/shixiao.svg" />
      <div class="tips_text">身份信息失效，请重新登录</div>
      <div class="fotter_btn">
        <el-button class="btn2" size="small" @click="reset">重新登录</el-button>
      </div>
    </el-dialog>
  </template>
  <script>
  // 引入element组件 在js引用的时候 全局标签还未挂载
  import { Dialog, Button } from "element-ui"; 
  import Vue from "vue";
  Vue.use(Dialog);
  Vue.use(Button);
  import store from "@/store";
  export default {
    data() {
      return {
        loseEfficacyModal: false,
      };
    },
    methods: {
      onShow() {
        this.loseEfficacyModal = true;
      },
      reset() {
        store.dispatch("logout").then(() => {
          this.loseEfficacyModal = false;
          this.$message.success("退出成功");
        });
      },
      handleClose() {
        this.loseEfficacyModal = false;
      },
    },
  };
  </script>
